package com.yb.xczx.cloud.system.controller;


import com.yb.xczx.cloud.system.service.IDictionaryService;
import com.yb.core.util.ResourceUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 数据字典 前端控制器
 * </p>
 *
 * @author 姚兵
 * @since 2023-05-07
 */
@RestController
@RequestMapping("/dictionary")
@Api("字典列表")
public class DictionaryController {

    @Autowired
    IDictionaryService dictionaryService;


    @GetMapping("all")
    @ApiOperation("查询所有字典列表")
    public List list(){
        return dictionaryService.listCache();
    }


    @GetMapping("resource")
    public String resource(){
       return ResourceUtil.loadResourceAsString("index.html");
    }

}
